﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>Introduction to Object Relational Mapping </title>
   <style type="text/css">
      html, body {
         font-size: 90%;
         font-family: Verdana, Sans-Serif;
      }
   </style>
</head>
<body>
   <h1>Introduction to Object Relational Mapping</h1>
   <hr />
   <h2>Brief overview</h2>
   <p>Google: <a href="http://www.google.com/search?q=object+relational+mapping+overview" target="_blank">object relational mapping overview</a></p>
   <blockquote>
      From the <a href="http://en.wikipedia.org/wiki/Object-relational_mapping" target="_blank">wiki</a>:<br />
      a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages
   </blockquote>
   <p>Chosen Tools</p>
   <ul>
      <li>ASP.NET MVC</li>
      <li>SQL Server Express</li>
      <li>NHibernate (Fluent Mapping and Linq)</li>
      <li>The June data dump of the StackOverflow database</li>
   </ul>
   <hr />
   <h2>Getting the bits</h2>
   <p>Google: <a href="http://www.google.com/search?q=fluent+nhibernate+download" target="_blank">fluent nhibernate download</a></p>
   <ul>
      <li>Download the latest version to your desktop (unblock the zip)</li>
      <li>Extract the entire zip to C:\temp\NHCourse\dependencies\nhibernate</li>
   </ul>
   <p>Google: <a href="http://www.google.com/search?q=nhibernate+linq+download" target="_blank">nhibernate linq download</a></p>
   <ul>
      <li>Download the nhibernate.linq zip (unblock)</li>
      <li>Extract all to C:\temp\NHCourse\dependencies\nhibernate</li>
   </ul>
   <p>Google: <a href="http://www.google.com/search?q=stackoverflow+data+dump" target="_blank">stackoverflow data dump</a></p>
   <ul>
      <li>Follow the cc-wiki-dump link to read about it and find out how to get it</li>
      <li>You should already have it as C:\temp\NHCourse\NHCourse.Mvc\App_Data\StackOverflow.mdf</li>
      <li>Data was imported from the data dump using <a href="http://meta.stackoverflow.com/questions/45333" target="_blank">SODDI</a></li>
   </ul>
   <hr />
   <h2>The Application</h2>
   <p>Open the solution C:\temp\NHCourse\IntroToORM.sln and Press Ctrl+F5 (<em>not</em> F5)</p>
   <ul>
      <li>Plain and simple user admin</li>
      <li>Everything you see is dummy data used to create the screens</li>
      <li>Task at hand is to replace the dummy data with live data from the SO database</li>
   </ul>
   <hr />
   <h2>Course Plan</h2>
   <ul>
      <li>8:00 - 9:00 - Brief overview and Getting the bits</li>
      <li>9:00 - 9:10 - Break</li>
      <li>9:10 - 10:00 - Convert the home and edit page to read/save live data</li>
      <li>10:00 - 10:10 - Break</li>
      <li>10:10 - 11:00<ul>
         <li>Setup logging so we can see the sql that nhibernate generates</li>
         <li>Map the <em>Posts</em> table and show post count in home page grid (not all columns)</li>
         <li>Map the <em>Votes</em> table and show total upvotes and downvotes on main grid (not all columns)</li>
         </ul>
      </li>
      <li>11:00 - 11:10 - Break</li>
      <li>11:10 - 12:00<ul>
         <li>Hard coded lookup tables: on <em>Post</em>, Map the post type column as a component</li>
         <li>Q&A</li>
         </ul>
      </li>
   </ul>
   <p>&nbsp;</p>
</body>
</html>
